﻿using System.Web;
using System.Web.SessionState;
using olierFrm.WebFormDev.Session;


namespace WebFormDev
{
    /// <summary>
    /// CloseModule 的摘要说明
    /// </summary>
    public class HandelModule : IHttpHandler, IRequiresSessionState
    {

        public void ProcessRequest(HttpContext context)
        {
            var action = context.Request.QueryString["action"];
            var moduleID = context.Request.QueryString["ModuleID"];

            if (action == "close")
            {
                if (context.Request.QueryString["QueryName"].Length != 0)
                {
                    SGrid.Clear(context.Request.QueryString["QueryName"]);
                }
                if (context.Request.QueryString["ObjectName"].Length != 0)
                {

                }
                SModule.Session.RemoveModule(moduleID);

            }
            else if (action == "open")
            {
                SModule.Session.AddModule(moduleID, context.Request.QueryString["ModuleName"]);
            }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}